import { getLocalKey, removeLocalKey, setLocalKey } from "@/utils/auth";
import { defineStore } from "pinia";
import { ref } from "vue";

export const userPinna=defineStore('login',()=>{
  const token=ref(getLocalKey()||'')
const setToken=(val:string)=>{
  token.value=val
  setLocalKey(val)
}
const clearToken=()=>{
  token.value=''
  removeLocalKey()
}
return {
  token,
  setToken,
  clearToken
}
})